package com.yuwei.home.adapter

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yuwei.home.R
import com.yuwei.home.entity.SimpleTypeEntityItem

class SimpleTypeAdapter: BaseQuickAdapter<SimpleTypeEntityItem, BaseViewHolder>(
    R.layout.item_simple_type
) {
    private var mPosition = 0
    fun setPosition(position: Int) {
        mPosition = position
    }
    override fun convert(holder: BaseViewHolder, item: SimpleTypeEntityItem) {
        val textView = holder.getView<TextView>(R.id.type_name)
        textView.text = item.typename
        if(mPosition == holder.adapterPosition){
            textView.setTextColor(Color.parseColor("#FF2442"))
        }else{
            textView.setTextColor(Color.parseColor("#4B5563"))
        }
    }
}